<?php
/**
 * Tela de visualiza��o das informa��es de um material.
 * @param $_GET['material_id'] - Chave-prim�ria no banco de dados do material a ser visualizado.  
*/

if( !function_exists('__autoload') )
{
    function __autoload($class_name) {
    require_once $class_name . '.php';
    }
}

SAEO::ValidarAcesso( array( ) );

$material = new Material();
$material_cadastrado = $material->CarregarMaterial( $_GET['material_id'] );
?>
<html>
	<head>
		<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>
		<link rel='stylesheet' type='text/css' href='templates/estilos.css'>
	</head>
	<body class='body'>
		<table width='100%' border='0'>
			<tr width='100%'>
				<td width='30%' class='textoTabelas'>Categoria: </td>
				<td width='70%' class='textoTabelas'><?php echo $material_cadastrado->categoria->nome; ?></td>
			</tr>
			<tr width='100%'>
				<td width='30%' class='textoTabelas'>Nome material: </td>
				<td width='70%' class='textoTabelas'><?php echo $material_cadastrado->nome; ?></td>
			</tr>
			<tr width='100%'>
				<td width='10%' class='textoTabelas'>CAT_MAT: </td>
				<td width='85%' class='textoTabelas'><?php echo $material_cadastrado->codigo ?></td>
			</tr>
			<tr width='100%'>
				<td width='10%' class='textoTabelas'>Valor: </td>
				<td width='85%' class='textoTabelas'>R$ <?php echo $material_cadastrado->valor; ?></td>
			</tr>
			<tr>
				<td class='textoTabelas' colspan='2'>Especificacao:</td>
			</tr>
			<tr>
				<td colspan='2'>
					<textarea rows='15' cols='90' style='margin-left:10px; 	font-family:Arial, Helvetica, sans-serif;
					font-size:12px;
					font-weight:bold;
					text-align:left;
					border:1px solid;
					border-color:#999999;' readonly='readonly'><?php echo $material_cadastrado->descricao ?></textarea>
				</td>
			</tr>
			<tr>
				<td class='textoTabelas'>Medida:</td>
				<td class='textoTabelas'><?php echo $material_cadastrado['sigla'].' - '.$material_cadastrado['capacidade'].' - '.$material_cadastrado['unidade']; ?></td>
			</tr>
		</table>
		<img src='templates/btfechar.JPG' style='margin-left:526px;margin-top:-61px;cursor: pointer' onClick='FecharDialogBuscaMaterial();'>
	</body>
</html>